package thread;

import java.io.InputStream;
import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
//        System.out.println("程序开始了");
//        try {
//            Thread.sleep(5000);
//        } catch (InterruptedException e) {
//            throw new RuntimeException(e);
//        }
//        System.out.println("程序结束了");

        InputStream inputStream ;


        Scanner scan = new Scanner(System.in);
        System.out.println("输入你要暂停的时间:");
        int a = scan.nextInt();
        for (int i=a;i>=0;i--){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(i);
        }
        System.out.println("程序结束了");
    }
}
